//
//  VideoPlayerController.h
//  UniversallyFramework
//
//  Created by lxin on 16/8/3.
//  Copyright © 2016年 liuf. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

@class ContentModel;

@protocol VideoPlayerControllerDelegate <NSObject>

- (void)onDidPlaySeries:(int)index; // 播放剧集
- (void)videoPlayingChange:(BOOL)isPlaying;
@end

/**
 *  将视频播放器作为一个独立的控制器，以便对视频播放器做更精准的操作
 */
@interface VideoPlayerController : UIViewController

@property (nonatomic, weak) id<VideoPlayerControllerDelegate> delegate;

@property (strong,nonatomic) ContentModel *contentModel;
@property (assign,nonatomic) float videoWidth;
@property (assign,nonatomic) float videoHeight;

-(void)refreshView;


/**
 *  播放内容中的视频
 */
-(void)playContent:(ContentModel *)contentModel;

/**
 *  播放剧集
 */
-(void)playSeries:(ContentModel *)contentModel index:(int)index;

/**
 *  退出播放视频
 */
- (void)cancel;

/**
 *  停止加载动画
 */
- (void)stopLoadAnimation;

/**
 *  获得当前播放时长
 *
 *  @return 播放时长
 */
- (CMTime)getCurrentPlaybackTime;

//交叉播放的时候设置音量
- (void)setVolume:(float)volume;

//暂时没用
//-(void)playerPlayOrPause:(BOOL)isPlay;
//播放暂停
- (void)play;
- (void)pause;


@end
